<?xml version="1.0" encoding="UTF-8"?><d:tdl xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://www.backbase.com/2006/btl"  xmlns:d="http://www.backbase.com/2006/tdl" >

	<d:namespace name="http://www.backbase.com/2006/btl">

		<d:uses element="element" src="../../element/element.xml"/>
		<d:uses element="dataMenuCommonBase dataMenuBase dataContextMenuBase" src="../dataMenuBase.xml"/>

		<d:element name="dataMenuCommon" extends="b:dataMenuCommonBase" abstract="true">
			

			<d:resource type="text/css"><![CDATA[.btl-dataMenuBar {
	background-image: url(media/menuBarBackground.png);
	background-repeat: repeat-x;
	background-color: #E0E0E0;
	cursor: default;
}
.btl-dataMenuBarItem {
	cursor: pointer;
}
.btl-dataMenuBarItem-icon {
	background-repeat: no-repeat;
	background-position: 6px center;
	padding-left: 25px !important; /* 16 + 6 + 3 */
}
.btl-dataMenuBarSeparator {
	width: 0;
	height: 100%;
	overflow: hidden;
	padding: 0;
}
.btl-dataMenuPopUp {
	position: absolute;
	z-index: 999;
	cursor: default;
}
.btl-dataMenuPopUpBorder {
	position: absolute;
	background-image: url(media/menuPopUp.png);
	background-repeat: repeat-y;
	background-color: #FAFAFA;
}
.btl-dataMenuPopUpItem {
	cursor: pointer;
}
.btl-dataMenuPopUpItem-icon {
	padding-left: 22px; /* 16 + 3 + 3 */
	background-position: 3px center;
	background-repeat: no-repeat;
}
.btl-dataMenuPopUpItem-label,
.btl-dataMenuPopUpItem-shortkey {
	vertical-align: middle;
	white-space: nowrap;
}
.btl-dataMenuPopUpItem-arrow {
	padding-right: 16px;
}
.btl-dataMenuPopUpItem-submenu {
	vertical-align: top;
}
.btl-dataMenuPopUpItem-arrow-show {
	background-image: url(media/arrowBlack.png);
	background-position: right center;
	background-repeat: no-repeat;
}
.btl-dataMenuPopUpSeparator {
	cursor: default;
}
.btl-dataMenuPopUpSeparator-div {
	height: 0;
	font-size: 0;
	line-height: 0;
	overflow: hidden;
	/* different colors from skinSettings to fit menu better */
	border-bottom: 1px solid #FFFFFF;
	border-top: 1px solid #D0D0D0;
}
.btl-dataMenuBarItem.btl-disabled,
.btl-disabled .btl-dataMenuPopUpItem-label {
	color: #CCC;
}
.btl-disabled .btl-dataMenuPopUpItem-arrow {
	background-image: none;
}
.btl-dataContextMenu {
	position: absolute;
	display: none;
}
.btl-dataMenu-open {
	display: block;
}
/* fixes */
.ie .btl-dataMenuBar {
	/* for opacity */
	zoom: 1.0;
}
.ie .btl-dataMenuBarItem .btl-label {
	/* seemed to need a little less padding to get the same height */
	padding-top: 2px;
	padding-bottom: 3px;
}
.ie .btl-dataMenuPopUpItem .btl-label {
	/* seemed to need a little less padding to get the same height */
	padding-top: 4px;
	padding-bottom: 4px;
}
.ie .btl-dataMenuBarSeparator .btl-dataMenuBarSeparator-div {
	width: 0; /* Without this 0 width div, the borders of the horizontal separator do not show in IE... */
}
.ie5_5 .btl-dataMenuPopUpSeparator-div {
	height: 2px;
}
.opera .btl-dataMenuPopUp .btl-dataMenuPopUp {
	z-index: auto;		/* Opera hover issue fix: reset z-index */
}
.opera .btl-dataMenuPopUp {
	/* Opera repaint issue fix */
	border: 1px solid transparent;
	margin: -1px 0 0 -1px;
}
.webkit .btl-dataMenuPopUpItem-submenu {
	padding-right: 1px;
}]]></d:resource>
			<d:resource type="image/png" src="media/arrowBlack.png"/>

			<d:resource name="data-template" type="application/xml"><![CDATA[
				]]><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

					<!-- set output method -->
					<xsl:output method="html" indent="no"/>

					<xsl:param name="currentHoverId"/>

					<xsl:template match="/">
						<xsl:apply-templates select="*"/>
					</xsl:template>

					<xsl:template match="menu">
						<table cellspacing="0" cellpadding="0">
							<tr>
								<xsl:apply-templates select="item"/>
							</tr>
						</table>
					</xsl:template>

					<xsl:template match="item">
						<td>
							<xsl:attribute name="btl_data-id"><xsl:value-of select="@id"/></xsl:attribute>
							<xsl:attribute name="class">
								<xsl:text>btl-dataMenuBarItem</xsl:text>
								<xsl:if test="@open = 'true' or $currentHoverId = @id">
									<xsl:text> btl-chameleon-highlightBackground btl-chameleon-highlightText</xsl:text>
								</xsl:if>
							</xsl:attribute>
							<div class="btl-dataMenuBarItem-label btl-label">
								<xsl:if test="string(icon)">
									<xsl:attribute name="class">btl-dataMenuBarItem-label btl-label btl-dataMenuBarItem-icon</xsl:attribute>
									<xsl:attribute name="style">background-image: url(<xsl:value-of select="icon"/>)</xsl:attribute>
								</xsl:if>
								<xsl:value-of select="name"/>
							</div>
							<xsl:if test="@open = 'true'">
								<xsl:apply-templates select="submenu"/>
							</xsl:if>
						</td>
					</xsl:template>

					<xsl:template match="submenu">
						<div class="btl-dataMenuPopUp btl-chameleon-normalText">
							<div class="btl-dataMenuPopUpBorder btl-ridge">
								<table border="0" cellspacing="0" cellpadding="0" class="btl-ridge-inner">
									<tbody>
										<xsl:apply-templates select="item"/>
									</tbody>
								</table>
							</div>
						</div>
					</xsl:template>

					<xsl:template match="item[@separator = 'true']">
						<td class="btl-dataMenuBarSeparator btl-bevel-left-right">
							<xsl:attribute name="btl_data-id"><xsl:value-of select="@id"/></xsl:attribute>
							<div class="btl-dataMenuBarSeparator-div"/>
						</td>
					</xsl:template>

					<xsl:template match="item[parent::submenu]">
						<tr>
							<xsl:attribute name="btl_data-id"><xsl:value-of select="@id"/></xsl:attribute>
							<xsl:attribute name="class">
								<xsl:text>btl-dataMenuPopUpItem</xsl:text>
								<xsl:if test="@open = 'true' or $currentHoverId = @id">
									<xsl:text> btl-chameleon-highlightBackground btl-chameleon-highlightText</xsl:text>
								</xsl:if>
							</xsl:attribute>
							<td class="btl-dataMenuPopUpItem-icon">
								<xsl:if test="string(icon)">
									<xsl:attribute name="style">background-image: url(<xsl:value-of select="icon"/>)</xsl:attribute>
								</xsl:if>
							</td>
							<td class="btl-dataMenuPopUpItem-label btl-label">
								<xsl:value-of select="name"/>
							</td>
							<td class="btl-dataMenuPopUpItem-shortkey"/>
							<td>
								<xsl:attribute name="class">
									<xsl:text>btl-dataMenuPopUpItem-arrow</xsl:text>
									<xsl:if test="@hasSubmenu = 'true'">
										<xsl:text> btl-dataMenuPopUpItem-arrow-show</xsl:text>
									</xsl:if>
								</xsl:attribute>
							</td>
							<td class="btl-dataMenuPopUpItem-submenu">
								<xsl:if test="@open = 'true'">
									<xsl:apply-templates select="submenu"/>
								</xsl:if>
							</td>
						</tr>
					</xsl:template>

					<xsl:template match="item[@separator = 'true'][parent::submenu]">
						<tr>
							<xsl:attribute name="btl_data-id"><xsl:value-of select="@id"/></xsl:attribute>
							<td class="btl-dataMenuPopUpSeparator" colspan="5">
								<div class="btl-dataMenuPopUpSeparator-div btl-groove-top-bottom"/>
							</td>
						</tr>
					</xsl:template>
				</xsl:stylesheet><![CDATA[
			]]></d:resource>

			<d:handler event="mouseenter" match="[btl_data-id]" type="text/javascript"><![CDATA[
				var oTarget = event.currentView;
				var aSiblings = oTarget.parentNode.childNodes;
				if (this.isSeparator(this.getIdFromView(oTarget)))
					oTarget = null; // don't select if separator
				for (var i = 0, len = aSiblings.length; i < len; i++) {
					if (aSiblings[i] == oTarget)
						bb.html.addClass(aSiblings[i], ['btl-chameleon-highlightBackground', 'btl-chameleon-highlightText']);
					else
						bb.html.removeClass(aSiblings[i], ['btl-chameleon-highlightBackground', 'btl-chameleon-highlightText']);
				}
			]]></d:handler>

			<d:handler event="mouseleave" match="[btl_data-id]" type="text/javascript"><![CDATA[
				var oTarget = event.currentView;
				var sId = this.getIdFromView(oTarget);
				if (!this.getOpen(sId))
					bb.html.removeClass(oTarget, ['btl-chameleon-highlightBackground', 'btl-chameleon-highlightText']);
			]]></d:handler>

			<d:property name="xsltProcessor">
				<!-- return a prepared XSLTProcessor object -->
				<d:getter type="text/javascript"><![CDATA[
					if (!this._._xsltProcessor) {
						this._._xsltProcessor = new XSLTProcessor();
						this._._xsltProcessor.importStylesheet(bb.getResource(this, 'data-template'));
					}
					var sCurrentHoverId = this.getProperty('currentHoverId');
					this._._xsltProcessor.setParameter(null, 'currentHoverId', sCurrentHoverId || '');
					return this._._xsltProcessor;
				]]></d:getter>
			</d:property>

			<d:method name="repaint">
				<d:argument name="records"/>
				<d:body type="text/javascript"><![CDATA[
					this.callSuper('repaint', [records]);

					if (bb.browser.opera)
						this.operaFix();
				]]></d:body>
			</d:method>

			<d:method name="operaFix">
				
				<d:body type="text/javascript"><![CDATA[
					// Opera repaint issue fix: set height of submenu containers to total height
					var tables = this.viewNode.getElementsByTagName('table');
					for (var i = 1; i < tables.length; i++) {
						var tableBox = bb.html.getBoxObject(tables[i]);
						var maxBottom = tableBox.top + tableBox.height;
						var subtables = tables[i].getElementsByTagName('table');
						for (var j = 0; j < subtables.length; j++) {
							var subtableBox = bb.html.getBoxObject(subtables[j]);
							var maxBottom = Math.max(maxBottom, subtableBox.top + subtableBox.height);
						}
						tables[i].parentNode.parentNode.style.height = maxBottom - tableBox.top + 10 + 'px'; // + 10 to compensate for rounding errors
					}
				]]></d:body>
			</d:method>

			<d:method name="setMenuOpen">
			<!-- this method exists because we can't call super properties... -->
				<d:argument name="value"/>
				<d:body type="text/javascript"><![CDATA[
					if (value)
						bb.html.addClass(this.viewNode, "btl-dataMenu-open");
					else
						bb.html.removeClass(this.viewNode, "btl-dataMenu-open");
				]]></d:body>
			</d:method>

			<d:constructor type="text/javascript"><![CDATA[
				bb.html.disableUserSelect(this.viewNode);
			]]></d:constructor>

			<d:handler event="contextmenu" type="text/javascript"><![CDATA[
				event.preventDefault();
			]]></d:handler>
		</d:element>

		<d:element name="dataMenu" extends="b:dataMenuCommon b:dataMenuBase">
			
			<d:template type="application/xhtml+xml">
				<div class="btl-dataMenuBar btl-bevel-top-bottom">
					<d:content/>
				</div>
			</d:template>
		</d:element>

		<d:element name="dataContextMenu" extends="b:dataMenuCommon b:dataContextMenuBase">
			
			<d:template type="application/xhtml+xml">
				<div class="btl-dataContextMenu">
					<d:content/>
				</div>
			</d:template>

			<d:method name="setMenuOpen">
				<d:argument name="value"/>
				<d:body type="text/javascript"><![CDATA[
					this.repaint();
					this.callSuper('setMenuOpen', [value]);
				]]></d:body>
			</d:method>

			<d:method name="repaint">
				<d:body type="text/javascript"><![CDATA[
					if (this.getProperty('open'))
						this.callSuper('repaint');
				]]></d:body>
			</d:method>
		</d:element>
	</d:namespace>
</d:tdl>